π― Complete System Design Interview Guide β 2025 Edition
Table of Contentsβ
- Low-Level Design (LLD) Problems
- High-Level Design (HLD) Problems
- Essential Design Patterns
- Core HLD Concepts
- Interview Preparation Roadmap
- Interview Day Strategy
- Essential Resources
- Final Tips for Success
- Common Pitfalls to Avoid
- Pre-Interview Checklist
π§© Low-Level Design (LLD) Problemsβ
1οΈβ£ Core Object-Oriented System Designsβ
Focus: Class hierarchy, associations, design patterns, SOLID principles
Must-Practice Systemsβ
- Parking Lot System β Multi-floor parking, slot allocation strategies, vehicle types, dynamic pricing
- Movie Ticket Booking System (BookMyShow) β Show scheduling, seat selection, booking lifecycle, payment processing
- Library Management System β Catalog management, borrowing/returning, fine calculation, reservation queue
- Hotel Management System β Room inventory, booking lifecycle, availability calendar, housekeeping integration
- ATM Machine β Card validation, transaction processing, cash dispensing, account management
- Vending Machine β State machine implementation, inventory tracking, payment handling, refund logic
Additional Practiceβ
- Car Rental System β Fleet management, pricing tiers, damage tracking
- Restaurant Management System β Table management, order queue, kitchen workflow
- Inventory Management System β Stock tracking, reorder points, supplier integration
- Customer Support System β Ticket routing, SLA tracking, escalation logic
2οΈβ£ Games & Rule-Based Systemsβ
Focus: Game state management, rule validation, turn-based logic
- Chess Game β Piece movement validation, check/checkmate detection, castling, en passant
- Snake and Ladder β Board representation, dice simulation, win condition
- Tic-Tac-Toe β Win detection algorithms, minimax AI implementation
- Deck of Cards β Generic card game framework, shuffle algorithms, dealing logic
- Sudoku Solver β Constraint validation, backtracking algorithm
- Battleship Game β Grid management, hit detection, game state tracking
3οΈβ£ Caching, Performance & Rate Limitingβ
Focus: Data structures, algorithms, optimization techniques
- LRU Cache β HashMap + Doubly Linked List, O(1) operations
- LFU Cache β Frequency-based eviction, min-heap optimization
- Rate Limiter β Token bucket, sliding window log, fixed window counter
- Logging Framework β Log levels, appenders (file, console, remote), async processing, rotation
- Circuit Breaker β Failure detection, half-open state, fallback mechanisms
4οΈβ£ Communication & Notification Systemsβ
Focus: Event-driven architecture, observer pattern, pub-sub
- Notification System β Multi-channel delivery (email, SMS, push), priority queue, retry logic
- Chat Application β Message persistence, delivery status, read receipts, group chat
- Collaborative Text Editor β Operational transformation, conflict resolution, cursor synchronization
- Comment System β Nested comments, voting, threading, moderation
5οΈβ£ Transaction & E-Commerce Systemsβ
Focus: State machines, payment flows, inventory management
- Shopping Cart β Product catalog, cart operations, discount engine, checkout flow
- Splitwise/Expense Sharing β Group management, debt calculation, settlement optimization
- Ride Booking System (Uber/Ola) β Driver-rider matching, fare calculation, trip lifecycle
- Payment Gateway β Transaction states, idempotency, webhook handling, retry logic
- Order Management System β Order states, fulfillment workflow, cancellation/refund handling
6οΈβ£ Scheduling & Resource Allocationβ
Focus: Time slot management, conflict resolution, optimization algorithms
- Meeting Room Booking β Calendar integration, conflict detection, recurring meetings
- Task Scheduler β Dependency graphs, priority queues, deadline management
- Elevator System β SCAN/LOOK algorithms, direction optimization, load balancing
- Traffic Signal Controller β State machines, timing optimization, emergency vehicle priority
- Parking Slot Allocation β Nearest slot algorithm, handicap priority, vehicle size matching
7οΈβ£ Data Organization & Hierarchical Systemsβ
Focus: Tree structures, composite pattern, CRUD operations
- File System β Directory tree, permissions (UNIX-style), symbolic links
- Stack Overflow Clone β Question/Answer model, tagging, voting, reputation system
- Social Media Feed β Post aggregation, comment threads, engagement metrics
- Directory Structure β Composite pattern, visitor pattern for operations
- Menu System β Nested categories, item variations, pricing rules
8οΈβ£ Design Patterns in Practiceβ
Focus: Real-world pattern applications
- Factory Pattern β Payment processor factory, vehicle factory
- Strategy Pattern β Sorting algorithms, pricing strategies, validation rules
- Observer Pattern β Event notification system, stock price monitoring
- Decorator Pattern β Pizza toppings, coffee add-ons, IO streams
- Command Pattern β Undo/redo functionality, macro recording
- Singleton Pattern β Configuration manager, logger, database connection pool
ποΈ High-Level Design (HLD) Problemsβ
π± Tier 1: Foundation Systems (Start Here)β
Focus: Core scalability concepts, basic distributed systems
- URL Shortener (bit.ly) β Hash generation, collision handling, analytics
- Pastebin β Content storage, expiration, syntax highlighting
- Key-Value Store β Consistent hashing, replication, eventual consistency
- Rate Limiter β Distributed rate limiting, Redis-based implementation
- File Hosting Service β Chunking, deduplication, metadata storage
π± Tier 2: Social Media & Content Platformsβ
Focus: Feed generation, ranking algorithms, caching strategies
Core Social Networksβ
- Twitter/X β Tweet ingestion, timeline generation, trending topics, @ mentions
- Instagram β Photo/video storage, feed ranking, stories (ephemeral content), explore page
- Facebook News Feed β Friend graph, edge rank algorithm, content mixing
- LinkedIn β Professional network, job recommendations, connection degrees
- TikTok/Reels β Short video recommendations, viral detection, creator analytics
Community Platformsβ
- Reddit β Subreddit architecture, voting system, hot/top algorithms
- Medium β Article publishing, claps system, reading time estimation
- Discord β Server/channel hierarchy, role permissions, voice channels
π¬ Tier 2: Streaming & Media Systemsβ
Focus: CDN, adaptive bitrate, recommendation engines
- YouTube β Video transcoding, CDN distribution, watch later, subscriptions
- Netflix β Adaptive streaming (HLS/DASH), personalization, continue watching
- Spotify β Audio streaming, playlist generation, collaborative filtering
- Twitch β Live streaming, chat integration, low-latency delivery
- Podcast Platform β RSS feed aggregation, download management, playback sync
π Tier 2: On-Demand & Real-Time Systemsβ
Focus: Geospatial indexing, real-time matching, ETA calculation
- Uber/Lyft β Driver-rider matching, surge pricing, trip routing, driver location updates
- Food Delivery (DoorDash/Zomato) β Restaurant inventory, delivery assignment, order tracking
- Airbnb β Listing search, availability calendar, booking workflow, review system
- Hotel Booking (Booking.com) β Inventory management, price comparison, cancellation policies
ποΈ Tier 2: E-Commerce & Marketplaceβ
Focus: Inventory consistency, checkout flow, recommendation systems
- Amazon β Product catalog, search ranking, cart management, order fulfillment
- eBay β Auction system, bidding logic, seller ratings
- Shopify β Multi-tenant architecture, payment processing, inventory sync
- Payment Gateway (Stripe/Razorpay) β Fraud detection, PCI compliance, ledger consistency
- Coupon/Promo System β Validation rules, usage limits, stacking logic
π Tier 3: Storage & Collaboration Systemsβ
Focus: Consistency models, conflict resolution, versioning
- Dropbox/Google Drive β File sync, delta updates, version history, sharing permissions
- Google Docs β Real-time collaboration, operational transformation, cursor tracking
- Notion β Block-based editor, nested pages, database views
- GitHub β Version control, pull requests, code review, CI/CD integration
- Distributed File System β HDFS-like architecture, replication, fault tolerance
π¬ Tier 3: Communication Platformsβ
Focus: Real-time protocols, message persistence, encryption
- WhatsApp/Telegram β End-to-end encryption, message delivery guarantees, media sharing
- Slack β Workspace isolation, channel threading, search indexing
- Zoom/Teams β WebRTC signaling, media servers, screen sharing, recording
- Email Service β SMTP/IMAP, spam filtering, attachment handling
- Video Conferencing β SFU vs MCU, bandwidth adaptation, recording
π Tier 3: Search & Discoveryβ
Focus: Indexing, ranking, autocomplete, geospatial queries
- Google Search β Web crawling, inverted index, PageRank, freshness
- Search Autocomplete β Trie data structure, query suggestion ranking
- Yelp/Foursquare β Geohash/Quadtree, proximity search, rating aggregation
- E-Commerce Search β Faceted search, filters, personalized ranking
- Type-ahead Search β Debouncing, caching, popularity signals
βοΈ Tier 4: Infrastructure & Distributed Componentsβ
Focus: Reliability, fault tolerance, consensus algorithms
Core Infrastructureβ
- Load Balancer β Health checks, algorithms (round-robin, least connections, consistent hashing)
- API Gateway β Authentication, rate limiting, request routing, API versioning
- Service Mesh β Sidecar pattern, circuit breakers, observability
- Distributed Cache (Redis/Memcached) β Cache invalidation, eviction policies, replication
Messaging & Streamingβ
- Message Queue (Kafka/RabbitMQ) β Pub-sub vs queue, ordering guarantees, partitioning
- Event Streaming Platform β Event sourcing, CQRS, replay capability
- Webhook Delivery System β Retry logic, dead letter queue, signature verification
Coordination Servicesβ
- Distributed Lock β Redlock algorithm, lease management
- Leader Election β Raft/Paxos consensus, split-brain prevention
- Service Discovery β Health checking, DNS-based vs client-side
- Configuration Management β Dynamic updates, versioning, rollback
π Tier 4: Analytics, Monitoring & Observabilityβ
Focus: Time-series data, log aggregation, real-time processing
- Metrics Monitoring (Prometheus/Datadog) β Time-series DB, aggregation, alerting
- Distributed Logging (ELK Stack) β Log collection, indexing, search, retention
- Distributed Tracing (Jaeger) β Span context propagation, sampling strategies
- Analytics Platform β Lambda architecture, batch + stream processing
- Ad Click Tracker β Fraud detection, real-time counting, attribution
- A/B Testing Platform β Traffic splitting, statistical significance, metrics tracking
π― Tier 5: Specialized & Advanced Systemsβ
Focus: Complex coordination, low-latency, domain-specific challenges
High-Performance Systemsβ
- Stock Exchange β Order matching engine, low-latency networking, market data feed
- Trading Platform β Order book, matching algorithms (FIFO, pro-rata), settlement
- Gaming Backend β Matchmaking, anti-cheat, leaderboards, game state sync
Content & Creator Platformsβ
- Online Code Editor (LeetCode/CodePen) β Sandboxing, code execution, real-time collaboration
- Live Streaming Platform β RTMP ingestion, transcoding, CDN, chat
- Content Recommendation β Collaborative filtering, matrix factorization, deep learning
Ticketing & Bookingβ
- Ticketmaster β Seat locking, inventory consistency, surge handling, bot prevention
- Flight Booking β Multi-leg search, fare rules, seat selection, cancellation
- Event Management β RSVP tracking, check-in, waitlist management
Specialized Infrastructureβ
- Web Crawler β Politeness, robots.txt, deduplication, distributed crawling
- Global Counter β Distributed counting, conflict resolution, eventual consistency
- Rate Limiting as a Service β Multi-tenant, configurable rules, analytics
- Feature Flag System β Dynamic configuration, targeting rules, gradual rollout
π¨ Essential Design Patterns Referenceβ
| Pattern | Primary Use Cases | LLD Examples |
|---|---|---|
| Singleton | Logger, Configuration Manager, Connection Pool | Logging System, Database Manager |
| Factory | Object creation without specifying exact class | Vehicle Factory, Payment Processor |
| Abstract Factory | Families of related objects | UI Toolkit (Windows/Mac themes) |
| Builder | Complex object construction | Order Builder, Query Builder |
| Prototype | Cloning expensive objects | Document templates |
| Strategy | Interchangeable algorithms | Pricing Strategy, Sort Strategy |
| Observer | Event notification, pub-sub | Notification System, Stock Ticker |
| Command | Encapsulate requests, undo/redo | Text Editor, Transaction System |
| State | Object behavior changes with state | Vending Machine, ATM, Order Lifecycle |
| Decorator | Add responsibilities dynamically | Stream wrappers, Pizza toppings |
| Adapter | Interface compatibility | Legacy system integration |
| Facade | Simplified interface to subsystem | API wrapper, Library interface |
| Composite | Tree structures, part-whole hierarchy | File System, Menu System |
| Proxy | Control access, lazy loading | Image Proxy, Access Control |
| Chain of Responsibility | Sequential request handling | Approval workflow, Logging levels |
| Template Method | Algorithm skeleton with customization | Data parser, Game framework |
βοΈ Core HLD Concepts Masteryβ
π― Scalability & Performanceβ
- Horizontal vs Vertical Scaling β When to scale out vs up
- Database Sharding β Hash-based, range-based, geo-based
- Partitioning Strategies β Consistent hashing, virtual nodes
- Replication β Master-slave, multi-master, quorum-based
- Caching Strategies β Cache-aside, write-through, write-back, write-around
- CDN Architecture β Edge locations, cache invalidation, origin shield
π Load Balancing & Routingβ
- Algorithms β Round robin, least connections, weighted, IP hash
- Layer 4 vs Layer 7 β TCP vs HTTP load balancing
- Health Checks β Active vs passive, failure detection
- Session Persistence β Sticky sessions, session replication
- Global Server Load Balancing β GeoDNS, latency-based routing
πΎ Database Designβ
- SQL vs NoSQL β ACID vs BASE, use case selection
- Normalization β 1NF, 2NF, 3NF, denormalization trade-offs
- Indexing β B-tree, hash, bitmap, composite indexes
- Query Optimization β Explain plans, covering indexes
- Transactions β Isolation levels, deadlock prevention
- Database Scaling β Read replicas, sharding, federation
ποΈ Architectural Patternsβ
- Microservices β Service boundaries, API contracts, data ownership
- Event-Driven Architecture β Event sourcing, CQRS, saga pattern
- Serverless β Function-as-a-Service, cold starts, stateless design
- Service Mesh β Istio/Linkerd, observability, traffic management
- API Gateway Pattern β Authentication, rate limiting, transformation
π¬ Messaging & Queuesβ
- Message Queue β Point-to-point, guaranteed delivery
- Pub-Sub β Topic-based, fan-out, message filtering
- Kafka Architecture β Topics, partitions, consumer groups, retention
- Message Ordering β Partition keys, sequence numbers
- Exactly-Once Semantics β Idempotency, deduplication
π Security & Reliabilityβ
- Authentication β JWT, OAuth 2.0, session management
- Authorization β RBAC, ABAC, policy enforcement
- Rate Limiting β Token bucket, leaky bucket, sliding window
- Circuit Breaker β Failure detection, fallback strategies
- Retry Strategies β Exponential backoff, jitter, idempotency
- Distributed Transactions β 2PC, Saga pattern, compensation
π Distributed Systemsβ
- CAP Theorem β Consistency, availability, partition tolerance trade-offs
- Consistency Models β Strong, eventual, causal, read-your-writes
- Consensus Algorithms β Raft, Paxos, leader election
- Distributed Locks β Redlock, Chubby, ZooKeeper
- Clock Synchronization β NTP, vector clocks, Lamport timestamps
- Split-Brain Prevention β Quorum, fencing tokens
π Monitoring & Observabilityβ
- Metrics β RED (Rate, Errors, Duration), USE (Utilization, Saturation, Errors)
- Logging β Structured logging, log levels, sampling
- Tracing β Distributed tracing, span context, sampling
- Alerting β Thresholds, anomaly detection, alert fatigue prevention
- SLIs/SLOs/SLAs β Service level objectives, error budgets